﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Cataloger
{
    public partial class FrmWybKategorii : Form
    {
        public FrmWybKategorii()
        {
            InitializeComponent();
            comboBox1.Items.AddRange(Kategoria.KategorieDostepne.ToArray());
        }
        public FrmWybKategorii(Katalog k)
            : this()
        {
            this.Text = k.Nazwa;
        }
        public FrmWybKategorii(Nosnik k)
            : this()
        {
            this.Text = k.Nazwa;
        }
        public FrmWybKategorii(Folder k)
            : this()
        {
            this.Text = k.Nazwa;
        }
        public FrmWybKategorii(Plik k)
            : this()
        {
            this.Text = k.Nazwa;
            comboBox1.Text = k.Kategoria.Nazwa;
        }
        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
        public Kategoria Kategor
        {
            get
            {
                return (Kategoria)comboBox1.SelectedItem;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
